package com.relife.sys.service;

import com.relife.common.utils.StringUtil;
import com.relife.core.entity.CodeEntity;
import com.relife.core.service.BaseService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;



@Service
@Transactional
public class CodeService extends BaseService {

	public void saveCode(CodeEntity code) {
		if (code.getParent() != null && StringUtil.isEmpty(code.getParent().getId())) {
			code.setParent(null);
		}
		this.saveOrUpdate(code);
	}
}
